package com.jiangore.mapper;

import com.jiangore.entity.Tag;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Todo
 * @Author jiangtao
 * @CreateBy 2020-03-09 1:48 PM
 * @UpdateBy jiangtao
 * @Version v1.0
 */
public class TagRowMapper implements RowMapper<Tag> {

    @Override
    public Tag mapRow(ResultSet rs, int i) throws SQLException {

        Tag t = Tag.builder()
                .id(rs.getInt("id"))
                .name(rs.getString("name"))
                .enable(rs.getInt("enable"))
                .build();
        return t;
    }
}
